<?php
    
    global $mikron;

    $cr = new Criterion('state', 2);
    $cr = new Criterion('chargeout', 0, CR_MORE, AO_AND, '`budget` - %s');
    $ads_blocks = $mikron->Queries->Query('SPONSOR_PROGRAM', null, $cr);
    
    while($ads = $ads_blocks->fetch())
    {
        echo $ads->ToString();
    }

?>